package com.jxwifi.cloud.quickclean.main;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.basicactivity.BasicActivity;
import com.idroid.utils.NoDoubleClickListener;
import com.jxwifi.cloud.quickclean.app.ClientBasicActivity;
import com.jxwifi.cloud.quickclean.utils.TitleClient;
import com.jxwifi.cloud.quickclean.R;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 价格说明
 * Created by Administrator on 2019/6/17.
 */

public class PriceExplainActivity extends ClientBasicActivity {

    @Bind(R.id.tv_price_explain_money)
    TextView mTvPriceExplainMoney;//预估价格
    @Bind(R.id.tv_explain_measure)
    TextView mTvExplainMeasure;
    @Bind(R.id.tv_explain_estimate)
    TextView mTvExplainEatimate;
    @Bind(R.id.tv_price_explain_earnest_money)
    TextView mTvPriceExplainEarnestMoney;//定金

    private String mCostDescription;
    private int mDefaultPrice;
    private int mHours;
    private int mEstimateMoney;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_price_explain);
        ButterKnife.bind(this);
        mCostDescription = getIntent().getStringExtra("costdescription");
        mDefaultPrice=getIntent().getIntExtra("defaultprice",0);
        mHours=getIntent().getIntExtra("hours",0);
        mEstimateMoney=getIntent().getIntExtra("estimatemoney",0);
        openEventBus();
        initHead();
        initView();
    }

    private void initHead() {
        TitleClient holder = new TitleClient(ButterKnife.findById(this, R.id.lin_client_title));
        holder.defineTitle("价格说明");
        holder.defineLeft(new NoDoubleClickListener() {
            @Override
            protected void onNoDoubleClick(View v) {
                onBackPressed();
            }
        });
    }

    public void initView(){
        mTvPriceExplainEarnestMoney.setText("\u00A5"+mEstimateMoney);
        mTvExplainMeasure.setText("("+mCostDescription+")");
        mTvExplainEatimate.setText("预估工作时长"+mHours+"小时");
        mTvPriceExplainMoney.setText("\u00A5"+mDefaultPrice);
    }
}
